<template>
  <div class="container" @click='handleGallaryClick'>
    <div class="wrapper">
      <swiper :options='swiperOptions'>
        <swiper-slide v-for='(item, key) in imgs' :key="key">
          <img :src="item" alt="" class="gallary-img">
        </swiper-slide>
        <!-- Optional controls -->
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  name: 'CommonGallary',
  props: {
    imgs: {
      type: Array,
      default () {
        return [

        ]
      }
    }
  },
  data () {
    return {
      swiperOptions: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observeParents: true,
        ovserver: true
      }
    }
  },
  components: {

  },
  methods: {
    handleGallaryClick () {
      this.$emit('close')
    }
  }
}
</script>

<style scoped lang="stylus">
.container >>> .swiper-.container
  overflow: inherit
.container
  position: fixed
  display: flex
  flex-direction: column
  justify-content: center
  left: 0
  top: 0
  bottom: 0
  right: 0
  background: #000
  z-index: 99
  .wrapper
    background: #fff
    width: 100%;
    padding-bottom: 20%
    height: 0
    .gallary-img
      width: 100%
    .swiper-pagination
      color: #ffffff
</style>
